package com.study.paymentdemo.vo;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lhl
 * @date 2024/12/4 11:27
 */
@Data
public class R {

    private Integer code;

    private String message;

    private Map<String,Object> data = new HashMap<>();


    public static R ok(){
        R r = new R();
        r.setCode(200);
        r.setMessage("支付成功");
        return r;
    }

    public static R error(){
        R r = new R();
        r.setCode(500);
        r.setMessage("支付失败");
        return r;
    }

    public R data(String key,Object value){
        this.data.put(key,value);
        return this;
    }
}
